<?php
$page = (intval($this->uri->segment(4)));
if ($page <= 1)
    $page = 0;
else
    $page = ($page - 1) * PAGE_SIZE
    ?>
<?= anchor($uri='admincp/admin_accessory_category/add_category', $title='Thêm danh mục mới', $attributes=array('class'=>'add')) ?>
<div style="float:left; width: 100%">
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
    <tbody>
        <tr >

            <th class="table-header-repeat line-left minwidth-1" ><a >#</a>	</th>
            <th class="table-header-repeat line-left minwidth-1"><a >Tên danh mục</a></th>
         
            <th class="table-header-options line-left"><a >Thao tác</a></th>
        </tr>
        <?php //if (isset($list)) { ?>

        <?php
        $i = 0;
        foreach ($list as $row):
            ?>

            <tr  style="text-transform: uppercase" <?= ($i % 2) ? 'class="alternate-row"' : '' ?>  >

                <td ><?= $i + $page + 1 ?></td>
                <td><?=  $row->category_name ?></td>
                <td class="options-width">
                    <a href="<?= HOME_PAGE.ADMIN_PAGE ?>admin_accessory_category/update_category/<?= $row->category_id ?>" class="icon-1 info-tooltip" title="Cập nhật"></a>
                    <a href="<?= HOME_PAGE.ADMIN_PAGE ?>admin_accessory_category/delete_category/<?= $row->category_id ?>" onclick="return confirm('Bạn muốn xóa?');" class="icon-2 info-tooltip" title="Xóa"></a>
                </td>
            </tr>
            <?php
            $i++;
        endforeach;
        ?>

        <?php // } ?>

    </tbody></table>
<!--  end product-table................................... --> 

<table border="0" cellpadding="0" cellspacing="0" >
    <tbody><tr>
            <td>
                <div class="paging">
                    <?= $this->pagination->create_links(); ?>
                </div>
            </td>

        </tr>
    </tbody></table>
</div>